<?php
namespace Home\Controller;
use Common\Model\ClassModel;
use Org\Util\DataTree;
class IndexController extends HomeQController {
    public function index(){
        //分配js到公共页面
        $conf=[
            'js'=>['index']
        ];
        $this->assign('conf',$conf);
        $confData=[
            'css'=>['index']
        ];
        $this->assign('confData',$confData);
        //获得分类数据
        $data=(new DataTree())->channelLevel((new ClassModel())->select(),$pid=0,$html="&nbsp",$fieldPri='cid',$fieldPri='pid');
        $this->assign('data',$data);
//        dd($data);
        //显示模板
        $this->display();
    }
}